package luj.tool.jnproxyan.proxy.network.socksv2.connection;

import io.netty.channel.Channel;
import io.netty.util.AttributeKey;
import luj.tool.jnproxyan.framework.lujnet.ConnState;

public class ConnStateAttr {

  public ConnStateAttr(Channel channel) {
    _channel = channel;
  }

  public void init(ConnState state) {
    _channel.attr(KEY).set(state);
  }

  public ConnState get() {
    return _channel.attr(KEY).get();
  }

  private static final AttributeKey<ConnState> KEY = AttributeKey.valueOf("proxy.c2p.conn");

  private final Channel _channel;
}
